#include"Shm.hpp"
#include<stdio.h>
#include"Fifo.hpp"
//管理者
int main()
{
    Shm shm(pathname,projid,CREATER);//
    NameFifo fifo(PATH,FIFO_NAME);
    
    //开始文件操作
    FileOper readerfile(PATH,FIFO_NAME);
   
    readerfile.OpenForRead();

    shm.VirtualAddr();
    char *mem =(char*)shm.VirtualAddr();

    while(true)
    {
        //readerfile.Read();//默认会阻塞
        if(readerfile.Wait())
        {
            printf("%s\n",mem);
            //sleep(1);
        }
        else break;

    }
    readerfile.Close();
    std::cout << "server end normal!" << std::endl;
    return 0;
}